<template>
  <div>APP!</div>
  <h2>自定义hook</h2>
  <h2>x:{{ x }},y:{{ y }}</h2>
  <h2 v-if="data">id:{{ data.id }}</h2>

</template>

<script lang="ts">
import {defineComponent} from 'vue';
import {mousePosition} from "@/hooks/useMousePosition";
import {useRequest} from "@/hooks/useRequest";

export default defineComponent({
  name: 'App',
  components: {},
  setup() {
    const {x, y} = mousePosition()
    const {data} = useRequest('/data/data.json');
    return {
      x, y, data
    }
  }
});
</script>

<style>

</style>
